package com.sjb.sixteen_journey_backend.entity.dto;

import com.sjb.sixteen_journey_backend.entity.User;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import jakarta.validation.groups.Default;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginDto implements Serializable {
    /**
     * 手机号，用户名，邮箱
     */
    @NotBlank(message = "该选项不能为空")
    private String name;
    /**
     * 密码
     */
    @NotBlank(groups = {User.Register.class},message = "密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9\u4e00-\u9fa5]{6,}$", message = "密码至少6位 支持中文、英文、数字")
    private String password;

    public interface Register extends Default {

    }
}
